package com.jvyou.driver.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    UNKNOWN_ERROR(400, "未知错误，请联系管理员反馈问题"),
    SYSTEM_ERROR(500, "系统出错,请联系管理员反馈问题"),
    //权限认证
    REQUIRE_TOKEN(403, "尚未登录，请登录后操作"),
    TOKEN_ERROR(304, "Token非法或者登录超时"),
    LOGIN_ERROR(403, "用户名或者密码错误"),
    LOGIN_OUT_TIME(304, "登录超时"),
    NO_OPERATOR_AUTH(413, "无操作权限"),
    REQUIRE_USERNAME(414, "用户名不能为空"),
    USERNAME_ERROR(414, "用户名格式错误"),
    REQUIRE_PASSWORD(415, "密码不能为空"),
    PASSWORD_ERROR(415, "密码格式错误"),
    REQUIRE_CONFIRM_PASSWORD(416, "确认密码不能为空"),
    CONFIRM_PASSWORD_ERROR(416, "两次密码不一致"),
    REQUIRE_EMAIL(417, "邮箱不能为空"),
    REQUIRE_CODE(418, "验证码不能为空"),
    USER_HAS_EXISTED(419, "用户已存在"),
    USER_HAS_NOT_EXISTED(420, "用户不存在"),
    REQUIRE_CHECK_CODE(421, "验证码不能为空"),
    CHECK_CODE_ERROR(422, "验证码错误"),
    FILE_SIZE_ERROR(423, "上传的文件大小错误，"),
    USER_STATUS_ABNORMAL(424, "用户状态异常"),
    DATA_SERVER_CONNECT_ERROR(501, "数据服务器连接异常，请联系管理员启动服务器"),
    REQUIRE_EMAIL_ADDRESS(412, "邮箱地址不为空"),
    CHECK_CODE_OUT_TIME(412, "验证码发送过于频繁"),
    INVALID_EMAIL(412, "无效的邮箱地址"),
    //Action
    ADD_FAIL(406, "添加失败"),
    DELETE_FAIL(408, "删除失败"),
    UPDATE_FAIL(407, "更新失败");

    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}